$(document).ready(function() {
// 在键盘按下并释放及提交后验证提交表单
// 管理员表单
  $("#form").validate({
	    rules: 
	    {
	    	userName: //姓名
	      {
	      	required: true,
	        maxlength: 4
	      },
	      oldPassword: //密码
	      {
	        required: true,
	        minlength: 6
	      },
	      newPassword: //密码
	      {
	        required: true,
	        minlength: 6
	      },
	      newPassword2: //密码
	      {
	        required: true,
	        minlength: 6
	      }  
	    },
	    messages: 
	    {
	    	userName: //姓名
		    {
		    	required:"此为必填字段",
		       	minlength: "姓名至多由4个字符组成，请选择实名注册"
		    },
		    oldPassword: //密码
		    {
		       required:"此为必填字段",
		       minlength:"密码至少由6个字符组成"
		    },
		     newPassword: //密码
		    {
		       required:"此为必填字段",
		       minlength:"密码至少由6个字符组成"
		    },
		    
		    newPassword2: //密码
		    {
		       required:"此为必填字段",
		       minlength:"密码至少由6个字符组成"
		    }   
		   
		}
	});
  
});